package com.cheyun.netsalev3.view

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProviders
import com.cheyun.netsalev3.R
import com.cheyun.netsalev3.bean.ClueDetails
import com.cheyun.netsalev3.bean.Data
import com.cheyun.netsalev3.bean.EditClueParam
import com.cheyun.netsalev3.databinding.ActivityAddSuccessBinding
import com.cheyun.netsalev3.utils.BaseActivity
import com.cheyun.netsalev3.utils.InjectorUtils
import com.cheyun.netsalev3.viewmodel.AddSuccessActivityViewModel

class AddSuccessActivity : BaseActivity<ActivityAddSuccessBinding>() {
    override fun initContentView(): Int {
        return R.layout.activity_add_success
    }

    override fun initViewModel(): ViewModel? {
        var clueDetails = intent.getSerializableExtra("clueDetails") as ClueDetails
        var data = intent.getSerializableExtra("data") as EditClueParam
        var come = ""
        if(intent.hasExtra("come")){
            come = intent.getStringExtra("come")
        }
        var keliudata: Data? = null
        if(intent.hasExtra("keliudata")) {
            keliudata = (intent.getSerializableExtra("keliudata") as Data)
        }
        var factory = InjectorUtils.getAddSuccessViewModelFactory(data,clueDetails,come,keliudata)
        return ViewModelProviders.of(this, factory).get(AddSuccessActivityViewModel::class.java)
    }

    override fun initView() {

    }

    override fun initData() {
    }

}
